package bjtu.cit.bookshop.service.impl;

import bjtu.cit.bookshop.daos.OrderBookMapper;
import bjtu.cit.bookshop.entities.OrderBook;
import bjtu.cit.bookshop.service.IOrderBookService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by jia19 on 2015/9/23.
 */
@Service("orderBookService")
public class OrderBookServiceImpl implements IOrderBookService {

    @Resource
    private OrderBookMapper orderBookMapper = null;

    @Override
    public List<OrderBook> getOrderBookListByOrderList(int id) {
        return this.orderBookMapper.selectListByOrderId(id);
    }

    @Override
    public int createAOrderBook(OrderBook orderBook) {
        return this.orderBookMapper.insertSelective(orderBook);
    }

    @Override
    public int deleteOrderBookByOrderId(int id) {
        return this.orderBookMapper.deleteByOrderid(id);
    }
}
